package com.lagou.rpc.config;

import org.I0Itec.zkclient.ZkClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * zookeeper客户端配置
 */
@Configuration
public class ZookeeperConfig {

    @Value("${zookeeper.server.url}")
    String zookeeperServerUrl;


    /**
     * 创建连接
     * @return
     */
    @Bean
    public ZkClient zkClient(){
        return new ZkClient(zookeeperServerUrl);
    }
}
